<div class="row">
    <div class="col-xs-12">
        <!-- PAGE CONTENT BEGINS -->
        <form class="form-horizontal" method="post" role="form">
            <!-- #section:elements.form -->
            <div class="form-group">
                <label class="col-sm-3 control-label no-padding-right" for="form-field-1">IP: </label>
                <div class="col-sm-9"> 
                    <input name="vars[ip]" class="col-xs-8 col-sm-3" type="text" value="{{.data.Ip}}" required>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label no-padding-right" for="form-field-1">Port: </label>
                <div class="col-sm-9"> 
                    <input name="vars[port]" class="col-xs-8 col-sm-3" type="text" value="{{if eq 0 .data.Port}}22{{else}}{{.data.Port}}{{end}}" required>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label no-padding-right" for="form-field-1">描述: </label>
                <div class="col-sm-9">
                    <input name="vars[desc]" class="col-xs-6 col-sm-3" type="text" required value="{{.data.Desc}}">
                    
                </div>
            </div>

            <div class="space-4"></div>

            <div class="form-group">
                <label class="col-sm-3 control-label no-padding-right" for="form-field-1">类型: </label>
                <div class="col-sm-9">

                    <label class="inline">
                        <input c name="vars[type]" class="ace type_choose_class" type="radio" value="0" {{if eq 0 .data.Type}}checked{{end}}>
                        <span class="lbl middle">用户和密码</span>
                    </label>
                    &nbsp; &nbsp; &nbsp;
                    <label class="inline">
                        <input name="vars[type]" class="ace type_choose_class" type="radio"  value="1" {{if eq 1 .data.Type}}checked{{end}}>
                        <span class="lbl middle">公钥登录</span>
                    </label>

                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label no-padding-right" for="form-field-1">登录名: </label>
                <div class="col-sm-9">
                    <input name="vars[user]" class="col-xs-6 col-sm-3" type="text" required value="{{.data.User}}">   
                </div>
            </div>

            <div id="group_pwd" class="form-group">
                <label class="col-sm-3 control-label no-padding-right" for="form-field-1">密码: </label>
                <div class="col-sm-9">
                    <input name="vars[pwd]" class="col-xs-6 col-sm-3" type="text" required value="{{.data.Pwd}}"> 
                </div>
            </div>

            <div id="group_rsa_key" class="form-group">
                <label class="col-sm-3 control-label no-padding-right" for="form-input-readonly"> 本机秘钥: </label>

                <div class="col-sm-9">
                    <div class="col-xs-6 col-sm-6"><pre>{{.rsaKey}}</pre></div>
                </div>
            </div>

            <div class="space-4"></div>
            
            <input name="id" type="hidden" value="{{.id}}">

            <div class="clearfix form-actions">
                <div class="col-md-offset-3 col-md-9">
                    <button class="btn btn-info" type="submit">
                        <i class="ace-icon fa fa-check bigger-110"></i>提交
                    </button>
                    &nbsp; &nbsp; &nbsp;
                    <button class="btn" type="reset">
                        <i class="ace-icon fa fa-undo bigger-110"></i>重置
                    </button>
                </div>
            </div>

        </form>
    </div><!-- /.col -->
</div>
<script>
jQuery(function($) {
//start

load_choose();
function load_choose(){
   var _tv = $('.type_choose_class:checked').val();
    if(_tv == 1){
        $('#group_pwd').addClass('hidden');
        $('#group_rsa_key').removeClass('hidden');
    } else {
        $('#group_pwd').removeClass('hidden');
        $('#group_rsa_key').addClass('hidden');
    }  
}
$('.type_choose_class').click(function(){
    load_choose();
});
//end
});
</script>